/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.lps.action;

/**
 *
 * @author thetrungbk
 */
public class LoginAction extends AbstractAction {

    private String username;
    private String password;

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        try {
            java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5");
            byte[] messageDigest = md.digest(password.getBytes());
            java.math.BigInteger number = new java.math.BigInteger(1, messageDigest);
            this.password = number.toString(16);
        } catch (java.security.NoSuchAlgorithmException ex) {
            ex.printStackTrace();
        }
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    /**
     *
     * @return
     */
    @Override
    public String getAction() {
        return "Login";
    }
}
